<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/11/11
 * Time: 10:08
 */

namespace Modules\Api\Http\Controllers;

use Illuminate\Http\Request;
use Modules\Api\Service\DiscoverService;

class DiscoverController extends BaseController
{

    /**
     *  获取朋友圈数据
     *  hinq 2019 11 12
     *
     **/
    public function index( Request $request ){
        $arr_input = (array) $request->all();
        $arr_list = DiscoverService::get_list( (array) $arr_input );
        return response_json( $arr_list );
    }

    /**
     *  添加发布朋友圈信息
     *  hinq 2019 11 11
     *
     **/
    public function store( Request $request ){
        $arr_input = (array) $request->all();
        $arr_list = DiscoverService::store( (array) $arr_input );
        return response_json( $arr_list );
    }

    /**
     *  获取指定的朋友圈数据(可以查看别人的数据)
     *  hinq 2019 11 11
     *
     **/
    public function detail( Request $request ){
        $nId = (int) $request->get('id');
        $arr_list = DiscoverService::detail( (int) $nId );
        return response_json( $arr_list );
    }

    /**
     *  修改发现（朋友圈）的阅读量和修改未读评论的状态
     *  hinq 2019 11 11
     *
     **/
    public function apprise_change( Request $request ){
        $nId = (int) $request->get('id');
        $arr_list = DiscoverService::apprise_change( (int) $nId );
        return response_json( $arr_list );
    }

    /**
     *  给朋友圈添加阅读量
     *  hinq 2019 11 25
     *
     **/
    public function increase_num( Request $request ){
        $nId = (int) $request->get('id');
        $arr_list = DiscoverService::increase_num( (int) $nId );
        return response_json( $arr_list );
    }

    /**
     *  获取指定的朋友圈的评论
     *  hinq 2019 11 11
     *
     **/
    public function apprise_list( Request $request ){
        $nId = $request->get('id');
        $arr_list = DiscoverService::apprise_list( (int) $nId );
        return response_json( $arr_list );
    }

    /**
     *  给指定的朋友圈、评论点赞
     *  hinq 2019 11 11
     *
     **/
    public function zan( Request $request ){
        $arr_input = (array) $request->all();
        $arr_list = DiscoverService::zan( (array) $arr_input );
        return response_json( $arr_list );
    }

    /**
     *  删除指定的评论数据
     *  hinq 2019 11 11
     *
     **/
    public function apprise_delete( Request $request ){
        $nId = (int) $request->get('id');
        $arr_list = DiscoverService::apprise_delete( (int) $nId );
        return response_json( $arr_list );
    }

    /**
     *  添加朋友圈的评论数据
     *  hinq 2019 11 11
     *
     **/
    public function apprise_store( Request $request ){
        $arr_input = (array) $request->all();
        $arr_list = DiscoverService::apprise_store( (array) $arr_input );
        return response_json( $arr_list );
    }

    /**
     *  发现（朋友圈）=》我的详细
     *  hinq 2019 11 11
     *
     **/
    public function my_info(){
        $arr_list = DiscoverService::my_info();
        return response_json( $arr_list );
    }

    /**
     *  发现（朋友圈）-》我的-》我的评论
     *  hinq 2019 11 12
     *
     **/
    public function my_apprise(){
        $arr_list = DiscoverService::my_apprise();
        return response_json( $arr_list );
    }

    /**
     *  发现（朋友圈）-》我的-》我的点赞
     *  hinq 2019 11 12
     *
     **/
    public function my_zan(){
        $arr_list = DiscoverService::my_zan();
        return response_json( $arr_list );
    }

    /**
     *  发现（朋友圈）-》我的-》我的发布（朋友圈）
     *  hinq 2019 11 12
     *
     **/
    public function my_list(){
        $arr_list = DiscoverService::my_list();
        return response_json( $arr_list );
    }

    /**
     *  发现（朋友圈）-》我的-》我的发布（朋友圈）-》删除
     *  hinq 2019 11 12
     *
     **/
    public function delete( Request $request ){
        $nId = (int) $request->get('id');
        $arr_list = DiscoverService::delete( (int) $nId );
        return response_json( $arr_list );
    }

}